<?php
namespace api\zhengmao\validate;
use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'mobile' => 'require',
        'code'=> 'require',
        'username' => 'require',
        'image' => 'require',
        //收货名
        'consignee'=>'require',
        'area'=>'require',
        'address'=>'require'
    ];

    protected $message = [
        'mobile.require' => '请输入手机号',
        'code.require' => '请输入验证码',
        'username.require' => '请输入姓名',
        'image.require' => '请添加图片',
        'consignee' => '请添加收货人姓名',
        'area' => '请添加区域',
        'address' => '请添加详细地址',
    ];
    protected $scene = [
        'register' => ['mobile','code'],
        'login' => ['mobile', 'code'],
        'update' =>['username','image'],
        'address'=>['mobile','consignee','area','address']
    ];
}
